import xpMtgSDK from '../../../services/mtgsdk/xpMtgSdk.umd'

// 获取应用实例
const app = getApp()
Page({
  data: {
    appid: '',
    path: '',
    params: {},
  },
  onLoad() {
    const _this = this
    xpMtgSDK.getStartInfo({}, function (res) {
      wx.hideHomeButton();
      var data = res.data.mini
      _this.appid = data.jump_appid
      _this.path = data.jump_path
      _this.params = data.params
    })
  },
  onclick() {
    const _this = this
    wx.navigateToMiniProgram({
      appId: _this.appid,
      path: _this.path,
      extraData: _this.params,
      envVersion: 'develop',
      success(res) {
        console.log('open success')
      },
      fail(res) {
        console.log('open fail')
      }
    })
  }
})
